home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / pwr14k.zip / DEMO1.PWR < prev    next >
Text File  |  1991-05-08  |  9KB  |  223 lines

  1. Variable        Fore,1               ;save ares for initial colors
  2. Variable        Back,1
  3. Variable        ColorAttr,1
  4. Variable        CharIn,1             ;for user responses
  5. Variable        RedOnGray,3,116
  6. Variable        RedOnBlack,3,4
  7. Variable        YelOnBlue,3,30
  8. Variable        YelOnGray,3,126
  9. Variable        BlueOnGray,3,113
  10. Variable        DOW,9                ;for date command
  11. Variable        Mo,2
  12. Variable        Da,2
  13. Variable        Yr,4
  14. Variable        CurrTime,11          ;for current time
  15. Variable        DirName,78           ;for user entered directory name
  16. Variable        FileName,78          ;for user entered file name
  17. Variable        Space35,35,"                                   "
  18. Variable        Space76,76,"                                                                            "
  19. Variable        TotSpace,10
  20. Variable        AvailSpace,10
  21. Variable        Msg,78
  22. Variable        Msg2,78
  23. Variable        FName,35
  24. Variable        LName,35
  25. ?Color          Fore,Back,ColorAttr  ;initial color
  26. ?Date           DOW,Mo,Da,Yr         ;get system date
  27. ?Time           CurrTime             ;get system time
  28. Clear
  29. ReadYN          "Do you have a color monitor? [Y/N] ",CharIn
  30. Compare         CharIn,"Y",,,ColorMon
  31. SetVar          RedOnGray,112
  32. SetVar          YelOnBlue,7
  33. SetVar          BlueOnGray,7
  34. Label           ColorMon
  35. Clear           BlueOnGray           ;clear to my color
  36. Box1            2,10,79,25,YelOnBlue ;info box border
  37. ClearBox        2,10,79,25,YelOnBlue ;     interior
  38. Color           RedOnGray
  39. Box3            24,1,56,5,RedOnBlack ;title box
  40. ClearBox        24,1,56,5,RedOnBlack
  41. Color           RedOnBlack
  42. Center          "POWERBATCH",2
  43. Center          "By",3
  44. Center          "Computing Systems Design, Inc.",4
  45. Color           YelOnBlue
  46. WriteAt         3,11,"PowerBatch is a power batch utility that produces COMPILED batch files."
  47. WriteAt         3,12,"With PowerBatch you can perform all standard DOS batch functions, plus"
  48. WriteAt         3,13,"use the 35 additional PowerBatch commands to create batch files with POWER."
  49. WriteAt         3,15,"PowerBatch compiles your batch commands and produces a standalone .EXE"
  50. WriteAt         3,16,"module that executes at the top speed of your computer. This information"
  51. WriteAt         3,17,"and demonstration program you are now running is a compiled PowerBatch"
  52. WriteAt         3,18,"program (the included source is DEMO1.PWR). PowerBatch is especially"
  53. WriteAt         3,19,"powerful for screen related functions. Draw boxes, write to the screen with"
  54. WriteAt         3,20,"blazing speed, control text colors with ease, get input from the user, make"
  55. WriteAt         3,21,"data comparisions and logic branches, and access system information with"
  56. WriteAt         3,22,"single commands. Follow this tour of the power in PowerBatch."
  57. GoToXY          26,24
  58. Write           "Press any key to continue...",RedOnGray
  59. ReadKey         CharIn
  60. Box3            2,10,79,25,YelOnBlue ;info box border
  61. ClearBox        2,10,79,25,YelOnBlue
  62. WriteAt         3,11,"PowerBatch gives you access to the system date and time and makes these"
  63. WriteAt         3,12,"available as variables for your use in screen writes."
  64. WriteAt         3,14,"The system date is returned in four variables of your choice. In these"
  65. GoToXY          3,15
  66. Write           "variables are placed Day of the week ("
  67. Write           DOW
  68. Write           ") Month number ("
  69. Write           Mo
  70. Write           "),"
  71. GoToXY          3,16
  72. Write           "Day number ("
  73. Write           Da
  74. Write           "), and Year number ("
  75. Write           Yr
  76. Write           ")."
  77. WriteAt         3,18,"In a like manner the current time may be retrieved into a variable of your"
  78. WriteAt         3,19,"choice, and used any way you wish."
  79. WriteAt         3,21,"Current time is "
  80. WriteAt         19,21,CurrTime
  81. GoToXY          26,24
  82. Color           YelOnBlue
  83. Blink
  84. Write           "Press any key to continue..."
  85. Normal
  86. ReadKey         CharIn
  87. Box2            2,10,79,25,YelOnGray ;info box border
  88. ClearBox        2,10,79,25,YelOnBlue
  89. WriteAt         3,11,"PowerBatch also provides you with several input commands to retrieve both"
  90. WriteAt         3,12,"data and question responses from the user. Commands are provided to retrieve"
  91. WriteAt         3,13,"one key (and one key only), read one key in upper case, read either Y or N"
  92. WriteAt         3,14,"for Yes/No responses, and to read a string of a specified length."
  93. GoToXY          3,15
  94. Write           "Enter one character in lower case [ ]"
  95. GoToXY          38,15
  96. ReadKey         CharIn
  97. GoToXY          41,15
  98. Write           "You can manipulate the case "
  99. GoToXY          3,16
  100. Write           "of the data entered changing from lower ["
  101. Write           CharIn
  102. Write           "] to upper ["
  103. Upper           CharIn
  104. Write           CharIn
  105. Write           "] to lower ["
  106. Lower           CharIn
  107. Write           CharIn
  108. Write           "]."
  109. WriteAt         3,18,"PowerBatch also contains strong string manipulation commands."
  110. WriteAt         3,19,"Enter your last name "
  111. ReadStr         LName
  112. WriteAt         14,19,Space35
  113. WriteAt         14,19,"first name "
  114. ReadStr         FName
  115. WriteAt         3,19,Space35
  116. Midstring       Msg,FName,1,3
  117. Midstring       Msg2,LName,1,3
  118. Concat          Msg," "
  119. Concat          Msg,Msg2
  120. WriteAt         3,20,Msg
  121. Wait            10
  122. Midstring       Msg,FName,1,6
  123. Midstring       Msg2,LName,1,6
  124. Concat          Msg," "
  125. Concat          Msg,Msg2
  126. WriteAt         3,20,Msg
  127. Wait            10
  128. Concat          Msg,FName," "
  129. Concat          Msg,LName
  130. WriteAt         3,20,Msg
  131. Length          Msg2,Msg
  132. Concat          Msg,"The length of this name field is ",Msg2
  133. WriteAt         3,21,Msg
  134. GoToXY          26,24
  135. Write           "Press any key to continue...",RedOnGray
  136. ReadKey         CharIn
  137. ClearBox        2,10,79,25,YelOnBlue
  138. WriteAt         3,11,"PowerBatch gives you the capability to verify drives, directories, or file"
  139. WriteAt         3,12,"names entered by the user. You may execute selected portions of the batch"
  140. WriteAt         3,13,"file based on the existance or non-existance of these entries."
  141. Label           ChekDrive
  142. GoToXY          3,15
  143. Write           "Enter a drive letter to be verified"
  144. Write           Space35
  145. GoToXY          39,15
  146. ReadUpKey       CharIn
  147. ?DriveExist     CharIn,GoodDrive
  148. Blink
  149. WriteAt         3,24,"That is not a valid drive in your system. Please re-enter."
  150. Normal
  151. Beep            750,8
  152. Wait            30
  153. WriteAt         3,24,Space76
  154. GoTo            ChekDrive
  155. Label           GoodDrive
  156. GoToXY          3,16
  157. Write           "Enter a directory name to be verified"
  158. Write           Space35
  159. GoToXY          41,16
  160. ReadStr         DirName
  161. ?DirExist       DirName,GoodDir
  162. Blink
  163. WriteAt         3,24,"That is not a valid directory in your system. Please re-enter."
  164. Normal
  165. Wait            30
  166. WriteAt         3,24,Space76
  167. GoTo            GoodDrive
  168. Label           GoodDir
  169. GoToXY          3,17
  170. Write           "Enter a file name to be verified"
  171. Write           Space35
  172. GoToXY          36,17
  173. ReadStr         FileName
  174. ?FileExist      FileName,GoodFile
  175. Blink
  176. WriteAt         3,24,"That is not a valid filename in your system. Please re-enter."
  177. Normal
  178. Wait            30
  179. WriteAt         3,24,Space76
  180. GoTo            GoodDir
  181. Label           GoodFile
  182. WriteAt         3,18,"PowerBatch can query your disk for total space and available space"
  183. WriteAt         3,19,"Drive [ ] capacities are (enter drive letter)"
  184. GoToXy          10,19
  185. ReadUpKey       CharIn
  186. ?DiskSpace      CharIn,TotSpace,AvailSpace
  187. Concat          Msg,CharIn," has "
  188. Concat          Msg,AvailSpace
  189. Concat          Msg," bytes available of the total "
  190. Concat          Msg,TotSpace
  191. Concat          Msg," bytes"
  192. WriteAt         9,19,Msg
  193. GoToXY          26,24
  194. Write           "Press any key to continue...",RedOnGray
  195. ReadKey         CharIn
  196. Clear
  197. WriteLine       "PowerBatch can run any valid DOS command that may be inserted in a batch file."
  198. WriteLine       "For example, here is a listing of your current directory..."
  199. Wait            30
  200. Clear           ColorAttr                           ;clear to default color
  201. Dir             "/w"
  202. Wait            30
  203. Color           YelOnBlue
  204. Clear
  205. WriteLine       "PowerBatch can also run (and return) other PowerBatch programs, giving you a "
  206. WriteLine       "subroutine capability. It has the capability to re-boot the system (which I"
  207. WriteLine       "will NOT demonstrate here."
  208. GoToXY          1,5
  209. WriteLine       "The purpose of this demonstration is to not only show you the capabilities"
  210. WriteLine       "of PowerBatch, but to let you compare the source with the running version"
  211. WriteLine       "of this program and aid you in the development of your own PowerBatch"
  212. WriteLine       "programs."
  213. GoToXY          1,10
  214. Write           "Press any key to continue..."
  215. ReadKey         CharIn
  216. Color           ColorAttr                       ;reset original colors
  217. Clear
  218. Box3            24,1,56,5,ColorAttr
  219. Center          "POWERBATCH",2
  220. Center          "By",3
  221. Center          "Computing Systems Design, Inc.",4
  222. GoToXy          1,24
  223.